home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
MIDITRAN.DOC
< prev
next >
Wrap
Text File
|
1996-06-08
|
6KB
|
165 lines
******************************
MIDITRAN v1.1
transposes various values in midi files
by Guenter Nagler
1995
(gnagler@ihm.tu-graz.ac.at)
******************************
[0] FEATURES
+ reads a binary midi file
+ writes a binary midi file
+ transposition of notes
+ changing note velocities
+ changing main volume values
+ selecting midi channels for transposition operations
[1] BACKGROUND
Sometimes I use my program MIDIKORG to mute a track of a general midi file
and try to play the track by myself on my keyboard. Specially when I
buy note sheets of a song I enjoy this possibility very much.
Recently I bought ABBA Gold notes and muted the melody track of the
song "Thank you for the Music" and tried to play according to the notes.
But this was not easy because the notes were printed in other key than
the midi file was sequenced.
This was the reason that I wrote a program that transposes the notes
of a midi file. It was very easy because its main program (C++ class)
was very close to MIDIKORG program that I programmed earlier.
To make it more useful I decided to enable incrementation of velocity values
and volume values too. Because incrementation of drum notes is not
useful I added the possibility to select the transpose channels.
[2] FILES DESCRIPTION
MIDITRAN.EXE.........converter program
MIDITRAN.DOC.........this file, showing usage of MIDITRAN.EXE
MIDIIO.HPP...........header file for a c++ midi parser
MIDIIO.CPP...........source code for a c++ midi parser
MIDITRAN.CPP.........c++ source code for midi to text
MIDITRAN.MAK.........make file for project
MIDITRAN.CFG.........compiler options for make
MIDITRAN.PRJ.........compiler project for borland c++ compilers
only MIDITRAN.EXE is required to run program
[3] COPYRIGHT
MIDITRAN (c) 1995 was created by Guenter Nagler.
MIDITRAN is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of MIDITRAN. Thus, you may NOT sell or bundle MIDITRAN with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give MIDITRAN to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
MIDITRAN was designed to handle 100% compatible midi files.
So I give no guarantees of the results, especially with non 100%
compatible midi files.
If you find a midi file that you think to be 100% compatible midi
that is not correctly converted, please send a sample file to
gnagler@ihm.tu-graz.ac.at .
Use MIDITRAN at your own risk. Anything you do with MIDITRAN is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running MIDITRAN
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using MIDITRAN, don't use it!
You are here forewarned.
[5] INSTALLATION
[MSDOS]
Simply copy MIDITRAN.EXE in a directory that is in your path.
When you start the program without arguments
[UNIX]
compile sources with your C++ compiler (e.g. GNU Compiler g++):
g++ -o miditran miditran.cpp midiio.cpp
and run program
$ miditran
C:\> MIDITRAN
you should get the usage text (see next section)
[6] USAGE
MidiTranspose increments notes,velocity,volume by a given value
usage: MidiTranspose [-q][-channel #][-velocity #][-volume #][-note #] file.mid transpos.mid
-q\tbe quiet
-velocity #\tadd # to all note velocities (-127..+127)
-volume #\tadd # to all volume events (-127..+127)
-note#\tadd # to all note values (-127..+127)
-channel #\tchanges are done only on these channels (1-16)
At least one of the options -velocity, -volume, -note must be used.
Default channels are 1-9 and 11-16 (drum channel 10 not included)
The parts in brackets [...] are optional.
Incrementation values can be negative (this is same as decrementation
of the invers value).
Note incrementation of +12 will transpose the notes by an octave
Warning:
Do not expect that MIDITRAN will produce a copy of the original
file if no translations are done! MIDI allows to encode its
commands in different ways without changing the semantic of the
notes (It is allowed to compress the midi file by ommiting
redunant command bytes, but it is no duty).
[8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
contains all my dos/unix midi programs
EMAIL: gnagler@ihm.tu-graz.ac.at
[9] USE
example: note transposition of a general midi file thankyou.mid
1. try to find key or a characteristic note of the song midi file
e.g. play midi and try to play a simple part with a keyboard
use MIDI2TXT to get note names of the midi files
thankyou.mid: C5 C5 C5 C5 B4 A4 ...
2. play the notes in the key that you want
or find the characteristic notes in the note sheets
note sheet: D5 D5 D5 D5 C#5 B4 ...
3. count the difference between the notes in both variants
C5 0
C#5 +1
D5 +2
4. miditran -note +2 thankyou.mid thank.mid
choose an alternate destination filename (e.g. thank.mid)
All notes but the drum notes on channel 10 are incremented by
value 2.
example: make drums on channel 10 heavier
miditran -velocity 20 -channel 10 song.mid heavier.mid
example: decrease volume at channels 3 and 5 by 10
miditran -volume -10 -channel 3 5 song.mid notloud.mid
This will only work if there are really volume midi commands
on these channels. If there is no such a command default volume
will be assumed and the decrementation can not be applied.
[10] CHANGES
v1.0 to v1.1:
* normalizing overflow/underflow of incrementation
* default channels are 1-16 except for incrementation of notes
(where notes on channel 10 are never incremented, because these are
different drum instruments)